<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>vuepress-plugin-mathjax | VuePress 社区</title>
    <meta name="description" content="社区维护的 VuePress 生态系统">
    <link rel="icon" href="/logo/600x600.png">
  <meta name="theme-color" content="#3eaf7c">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="msapplication-TileColor" content="#000000">
    <link rel="preload" href="/assets/css/0.styles.bde909c2.css" as="style"><link rel="preload" href="/assets/js/app.83cb924b.js" as="script"><link rel="preload" href="/assets/js/2.96e68d5e.js" as="script"><link rel="preload" href="/assets/js/28.68a7bdf2.js" as="script"><link rel="preload" href="/assets/js/6.b1866fbb.js" as="script"><link rel="preload" href="/assets/js/5.1cd3ace7.js" as="script"><link rel="prefetch" href="/assets/js/10.8fab5e9f.js"><link rel="prefetch" href="/assets/js/11.9e66637f.js"><link rel="prefetch" href="/assets/js/12.23a476a6.js"><link rel="prefetch" href="/assets/js/13.cbd5d914.js"><link rel="prefetch" href="/assets/js/14.78046e0f.js"><link rel="prefetch" href="/assets/js/15.15f2d0bd.js"><link rel="prefetch" href="/assets/js/16.c749a5c9.js"><link rel="prefetch" href="/assets/js/17.f54b2102.js"><link rel="prefetch" href="/assets/js/18.0da93583.js"><link rel="prefetch" href="/assets/js/19.7ec782b6.js"><link rel="prefetch" href="/assets/js/20.2ac16953.js"><link rel="prefetch" href="/assets/js/21.059dc84f.js"><link rel="prefetch" href="/assets/js/22.b80a1088.js"><link rel="prefetch" href="/assets/js/23.14ac2e9b.js"><link rel="prefetch" href="/assets/js/24.645912bb.js"><link rel="prefetch" href="/assets/js/25.d99ab9d1.js"><link rel="prefetch" href="/assets/js/26.439ac2ad.js"><link rel="prefetch" href="/assets/js/27.7a5265ba.js"><link rel="prefetch" href="/assets/js/29.83d3986f.js"><link rel="prefetch" href="/assets/js/3.e29c89cb.js"><link rel="prefetch" href="/assets/js/30.44036763.js"><link rel="prefetch" href="/assets/js/31.4e32f3c0.js"><link rel="prefetch" href="/assets/js/32.5c64f4c8.js"><link rel="prefetch" href="/assets/js/33.bc6170ff.js"><link rel="prefetch" href="/assets/js/34.2a1877c0.js"><link rel="prefetch" href="/assets/js/35.6a0693b1.js"><link rel="prefetch" href="/assets/js/36.036cfdd9.js"><link rel="prefetch" href="/assets/js/37.5c4deb98.js"><link rel="prefetch" href="/assets/js/4.a98f17db.js"><link rel="prefetch" href="/assets/js/7.757f3a25.js"><link rel="prefetch" href="/assets/js/8.e5910e9d.js"><link rel="prefetch" href="/assets/js/9.68190a5d.js">
    <link rel="stylesheet" href="/assets/css/0.styles.bde909c2.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/zh/" class="home-link router-link-active"><!----> <span class="site-name">VuePress 社区</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">选择语言</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/en/plugins/mathjax/" class="nav-link">English</a></li><li class="dropdown-item"><!----> <a href="/zh/plugins/mathjax/" class="nav-link router-link-exact-active router-link-active">简体中文</a></li></ul></div></div> <a href="https://github.com/vuepress/vuepress.github.io" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">选择语言</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/en/plugins/mathjax/" class="nav-link">English</a></li><li class="dropdown-item"><!----> <a href="/zh/plugins/mathjax/" class="nav-link router-link-exact-active router-link-active">简体中文</a></li></ul></div></div> <a href="https://github.com/vuepress/vuepress.github.io" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>插件</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/zh/plugins/container/" class="sidebar-link">vuepress-plugin-container</a></li><li><a href="/zh/plugins/copyright/" class="sidebar-link">vuepress-plugin-copyright</a></li><li><a href="/zh/plugins/clean-urls/" class="sidebar-link">vuepress-plugin-clean-urls</a></li><li><a href="/zh/plugins/dehydrate/" class="sidebar-link">vuepress-plugin-dehydrate</a></li><li><a href="/zh/plugins/git-log/" class="sidebar-link">vuepress-plugin-git-log</a></li><li><a href="/zh/plugins/mathjax/" class="active sidebar-link">vuepress-plugin-mathjax</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#用法" class="sidebar-link">用法</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#全局安装" class="sidebar-link">全局安装</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#局部安装" class="sidebar-link">局部安装</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#添加到-config-js" class="sidebar-link">添加到 config.js</a></li></ul></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#语法" class="sidebar-link">语法</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#行内语法" class="sidebar-link">行内语法</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#块语法" class="sidebar-link">块语法</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#一些约定" class="sidebar-link">一些约定</a></li></ul></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#特性" class="sidebar-link">特性</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#使用宏" class="sidebar-link">使用宏</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#使用预设" class="sidebar-link">使用预设</a></li></ul></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#配置" class="sidebar-link">配置</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#target" class="sidebar-link">target</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#packages" class="sidebar-link">packages</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#macros" class="sidebar-link">macros</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#presets" class="sidebar-link">presets</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#showerror" class="sidebar-link">showError</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#cache" class="sidebar-link">cache</a></li></ul></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#其他" class="sidebar-link">其他</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#依赖" class="sidebar-link">依赖</a></li><li class="sidebar-sub-header"><a href="/zh/plugins/mathjax/#相关工具" class="sidebar-link">相关工具</a></li></ul></li></ul></li><li><a href="/zh/plugins/medium-zoom/" class="sidebar-link">vuepress-plugin-medium-zoom</a></li><li><a href="/zh/plugins/migrate/" class="sidebar-link">vuepress-plugin-migrate</a></li><li><a href="/zh/plugins/named-chunks/" class="sidebar-link">vuepress-plugin-named-chunks</a></li><li><a href="/zh/plugins/nprogress/" class="sidebar-link">vuepress-plugin-nprogress</a></li><li><a href="/zh/plugins/redirect/" class="sidebar-link">vuepress-plugin-redirect</a></li><li><a href="/zh/plugins/serve/" class="sidebar-link">vuepress-plugin-serve</a></li><li><a href="/zh/plugins/zooming/" class="sidebar-link">vuepress-plugin-zooming</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>工具</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="vuepress-plugin-mathjax"><a href="#vuepress-plugin-mathjax" aria-hidden="true" class="header-anchor">#</a> vuepress-plugin-mathjax <a rel="noopener noreferrer" target="_blank" title="vuepress/vuepress-plugin-mathjax" href="https://github.com/vuepress/vuepress-plugin-mathjax" class="github-link"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28"><path d="M14 0C6.27 0 0 6.43 0 14.36c0 6.34 4.01 11.72 9.57 13.62.7.13.96-.31.96-.69 0-.34-.01-1.24-.02-2.44-3.89.87-4.72-1.92-4.72-1.92-.64-1.66-1.55-2.1-1.55-2.1-1.27-.89.1-.87.1-.87 1.4.1 2.14 1.48 2.14 1.48 1.25 2.19 3.28 1.56 4.07 1.19.13-.93.49-1.56.89-1.92-3.11-.36-6.38-1.59-6.38-7.09 0-1.57.55-2.85 1.44-3.85-.14-.36-.62-1.82.14-3.8 0 0 1.18-.39 3.85 1.47a12.8 12.8 0 0 1 3.5-.48c1.19.01 2.39.16 3.5.48 2.67-1.86 3.85-1.47 3.85-1.47.76 1.98.28 3.44.14 3.8.9 1 1.44 2.28 1.44 3.85 0 5.51-3.27 6.73-6.39 7.08.5.44.95 1.32.95 2.66 0 1.92-.02 3.47-.02 3.94 0 .38.25.83.96.69C23.99 26.07 28 20.7 28 14.36 28 6.43 21.73 0 14 0z" fill-rule="evenodd" clip-rule="evenodd"></path></svg></a></h1> <p><code>vuepress-plugin-mathjax</code> 是一个在 markdown 中支持 TeX 语法的 VuePress 插件。</p> <p><strong>输入:</strong></p> <pre class="math-block">假设 $y &gt;= 0$ , 而 $[\log x]$ 表示 $\log x$ 的整数部分, 设:
$$\Phi (y) = \frac {1} {2 \pi i} \int_{2 - i \infty}^{2 + i \infty} \frac {y^{\omega} \mathrm{d} \omega} {\omega \left(1 + \frac {\omega} {(\log x)^{1.1}}\right)^{[ \log x ] + 1}}, x &gt; 1$$
显见， 当 $0 &lt;= y &lt;= 1$ 时， 有 $\Phi(y) = 0$. 对于所有 $y &gt;= 0$, 则 $\Phi(y)$ 是一个非减函数.
当 $\log x&gt;= 10^4$ 及 $y&gt;= e^{2{(\log x)}^{-0.1}}$ 时， 则有:
$$1 - x^{- 0.1} &lt;= \Phi (y) &lt;= 1
</pre> <p><strong>输出:</strong></p> <div class="math-block"><p>假设 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-mo space="4" class="mjx-n"><mjx-c c="2A7E"></mjx-c></mjx-mo><mjx-mn space="4" class="mjx-n"><mjx-c c="0"></mjx-c></mjx-mn></mjx-math></mjx-container> , 而 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mo class="mjx-n"><mjx-c c="["></mjx-c></mjx-mo><mjx-mi class="mjx-n"><mjx-c c="l"></mjx-c><mjx-c c="o"></mjx-c><mjx-c c="g"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="2061"></mjx-c></mjx-mo><mjx-mi space="2" class="mjx-i"><mjx-c c="x"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="]"></mjx-c></mjx-mo></mjx-math></mjx-container> 表示 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mi class="mjx-n"><mjx-c c="l"></mjx-c><mjx-c c="o"></mjx-c><mjx-c c="g"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="2061"></mjx-c></mjx-mo><mjx-mi space="2" class="mjx-i"><mjx-c c="x"></mjx-c></mjx-mi></mjx-math></mjx-container> 的整数部分, 设:</p> <p></p><p><mjx-container jax="CHTML" display="true" class="MathJax"><mjx-math display="true" class=" MJX-TEX"><mjx-mi class="mjx-n"><mjx-c c="3A6"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="("></mjx-c></mjx-mo><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c=")"></mjx-c></mjx-mo><mjx-mo space="4" class="mjx-n"><mjx-c c="="></mjx-c></mjx-mo><mjx-mfrac space="4"><mjx-frac type="d"><mjx-num><mjx-nstrut type="d"></mjx-nstrut><mjx-mn class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn></mjx-num><mjx-dbox><mjx-dtable><mjx-line type="d"></mjx-line><mjx-row><mjx-den><mjx-dstrut type="d"></mjx-dstrut><mjx-mrow><mjx-mn class="mjx-n"><mjx-c c="2"></mjx-c></mjx-mn><mjx-mi class="mjx-i"><mjx-c c="3C0"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c c="i"></mjx-c></mjx-mi></mjx-mrow></mjx-den></mjx-row></mjx-dtable></mjx-dbox></mjx-frac></mjx-mfrac><mjx-msubsup space="2"><mjx-mo noIC="true" class="mjx-lop"><mjx-c c="222B"></mjx-c></mjx-mo><mjx-script style="vertical-align:-0.896em;"><mjx-TeXAtom size="s" style="margin-left:0.729em;"><mjx-mn class="mjx-n"><mjx-c c="2"></mjx-c></mjx-mn><mjx-mo class="mjx-n"><mjx-c c="+"></mjx-c></mjx-mo><mjx-mi class="mjx-i"><mjx-c c="i"></mjx-c></mjx-mi><mjx-mi class="mjx-n"><mjx-c c="221E"></mjx-c></mjx-mi></mjx-TeXAtom><mjx-spacer style="margin-top:1.455em;"></mjx-spacer><mjx-TeXAtom size="s"><mjx-mn class="mjx-n"><mjx-c c="2"></mjx-c></mjx-mn><mjx-mo class="mjx-n"><mjx-c c="2212"></mjx-c></mjx-mo><mjx-mi class="mjx-i"><mjx-c c="i"></mjx-c></mjx-mi><mjx-mi class="mjx-n"><mjx-c c="221E"></mjx-c></mjx-mi></mjx-TeXAtom></mjx-script></mjx-msubsup><mjx-mfrac space="2"><mjx-frac type="d"><mjx-num><mjx-nstrut type="d"></mjx-nstrut><mjx-mrow><mjx-msup><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-script style="vertical-align:0.363em;"><mjx-TeXAtom size="s"><mjx-mi class="mjx-i"><mjx-c c="3C9"></mjx-c></mjx-mi></mjx-TeXAtom></mjx-script></mjx-msup><mjx-TeXAtom><mjx-mi class="mjx-n"><mjx-c c="d"></mjx-c></mjx-mi></mjx-TeXAtom><mjx-mi class="mjx-i"><mjx-c c="3C9"></mjx-c></mjx-mi></mjx-mrow></mjx-num><mjx-dbox><mjx-dtable><mjx-line type="d"></mjx-line><mjx-row><mjx-den><mjx-dstrut type="d"></mjx-dstrut><mjx-mrow><mjx-mi class="mjx-i"><mjx-c c="3C9"></mjx-c></mjx-mi><mjx-msup><mjx-mrow><mjx-mo class="mjx-lop"><mjx-c c="("></mjx-c></mjx-mo><mjx-mn class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn><mjx-mo space="3" class="mjx-n"><mjx-c c="+"></mjx-c></mjx-mo><mjx-mfrac space="3"><mjx-frac><mjx-num><mjx-nstrut></mjx-nstrut><mjx-mi size="s" class="mjx-i"><mjx-c c="3C9"></mjx-c></mjx-mi></mjx-num><mjx-dbox><mjx-dtable><mjx-line></mjx-line><mjx-row><mjx-den><mjx-dstrut></mjx-dstrut><mjx-mrow size="s"><mjx-mo class="mjx-n"><mjx-c c="("></mjx-c></mjx-mo><mjx-mi class="mjx-n"><mjx-c c="l"></mjx-c><mjx-c c="o"></mjx-c><mjx-c c="g"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="2061"></mjx-c></mjx-mo><mjx-mi space="2" class="mjx-i"><mjx-c c="x"></mjx-c></mjx-mi><mjx-msup><mjx-mo class="mjx-n"><mjx-c c=")"></mjx-c></mjx-mo><mjx-script style="vertical-align:0.363em;"><mjx-TeXAtom size="s"><mjx-mn class="mjx-n"><mjx-c c="1"></mjx-c><mjx-c c="."></mjx-c><mjx-c c="1"></mjx-c></mjx-mn></mjx-TeXAtom></mjx-script></mjx-msup></mjx-mrow></mjx-den></mjx-row></mjx-dtable></mjx-dbox></mjx-frac></mjx-mfrac><mjx-mo class="mjx-lop"><mjx-c c=")"></mjx-c></mjx-mo></mjx-mrow><mjx-script style="vertical-align:0.877em;"><mjx-TeXAtom size="s"><mjx-mo class="mjx-n"><mjx-c c="["></mjx-c></mjx-mo><mjx-mi class="mjx-n"><mjx-c c="l"></mjx-c><mjx-c c="o"></mjx-c><mjx-c c="g"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="2061"></mjx-c></mjx-mo><mjx-mi space="2" class="mjx-i"><mjx-c c="x"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="]"></mjx-c></mjx-mo><mjx-mo class="mjx-n"><mjx-c c="+"></mjx-c></mjx-mo><mjx-mn class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn></mjx-TeXAtom></mjx-script></mjx-msup></mjx-mrow></mjx-den></mjx-row></mjx-dtable></mjx-dbox></mjx-frac></mjx-mfrac><mjx-mo class="mjx-n"><mjx-c c=","></mjx-c></mjx-mo><mjx-mi space="2" class="mjx-i"><mjx-c c="x"></mjx-c></mjx-mi><mjx-mo space="4" class="mjx-n"><mjx-c c="&gt;"></mjx-c></mjx-mo><mjx-mn space="4" class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn></mjx-math></mjx-container></p><p></p> <p>显见, 当 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mn class="mjx-n"><mjx-c c="0"></mjx-c></mjx-mn><mjx-mo space="4" class="mjx-n"><mjx-c c="2A7D"></mjx-c></mjx-mo><mjx-mi space="4" class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-mo space="4" class="mjx-n"><mjx-c c="2A7D"></mjx-c></mjx-mo><mjx-mn space="4" class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn></mjx-math></mjx-container> 时, 有 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mi class="mjx-n"><mjx-c c="3A6"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="("></mjx-c></mjx-mo><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c=")"></mjx-c></mjx-mo><mjx-mo space="4" class="mjx-n"><mjx-c c="="></mjx-c></mjx-mo><mjx-mn space="4" class="mjx-n"><mjx-c c="0"></mjx-c></mjx-mn></mjx-math></mjx-container>. 对于所有 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-mo space="4" class="mjx-n"><mjx-c c="2A7E"></mjx-c></mjx-mo><mjx-mn space="4" class="mjx-n"><mjx-c c="0"></mjx-c></mjx-mn></mjx-math></mjx-container>, 则 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mi class="mjx-n"><mjx-c c="3A6"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="("></mjx-c></mjx-mo><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c=")"></mjx-c></mjx-mo></mjx-math></mjx-container> 是一个非减函数.</p> <p>当 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mi class="mjx-n"><mjx-c c="l"></mjx-c><mjx-c c="o"></mjx-c><mjx-c c="g"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="2061"></mjx-c></mjx-mo><mjx-mi space="2" class="mjx-i"><mjx-c c="x"></mjx-c></mjx-mi><mjx-mo space="4" class="mjx-n"><mjx-c c="2A7E"></mjx-c></mjx-mo><mjx-msup><mjx-mn class="mjx-n"><mjx-c c="1"></mjx-c><mjx-c c="0"></mjx-c></mjx-mn><mjx-script style="vertical-align:0.393em;"><mjx-mn size="s" class="mjx-n"><mjx-c c="4"></mjx-c></mjx-mn></mjx-script></mjx-msup></mjx-math></mjx-container> 及 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-mo space="4" class="mjx-n"><mjx-c c="2A7E"></mjx-c></mjx-mo><mjx-msup space="4"><mjx-mi class="mjx-i"><mjx-c c="e"></mjx-c></mjx-mi><mjx-script style="vertical-align:0.363em;"><mjx-TeXAtom size="s"><mjx-mn class="mjx-n"><mjx-c c="2"></mjx-c></mjx-mn><mjx-msup><mjx-TeXAtom><mjx-mo class="mjx-n"><mjx-c c="("></mjx-c></mjx-mo><mjx-mi class="mjx-n"><mjx-c c="l"></mjx-c><mjx-c c="o"></mjx-c><mjx-c c="g"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="2061"></mjx-c></mjx-mo><mjx-mi space="2" class="mjx-i"><mjx-c c="x"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c=")"></mjx-c></mjx-mo></mjx-TeXAtom><mjx-script style="vertical-align:0.477em;"><mjx-TeXAtom size="s"><mjx-mo class="mjx-n"><mjx-c c="2212"></mjx-c></mjx-mo><mjx-mn class="mjx-n"><mjx-c c="0"></mjx-c><mjx-c c="."></mjx-c><mjx-c c="1"></mjx-c></mjx-mn></mjx-TeXAtom></mjx-script></mjx-msup></mjx-TeXAtom></mjx-script></mjx-msup></mjx-math></mjx-container> 时, 则有:</p> <p></p><p><mjx-container jax="CHTML" display="true" class="MathJax"><mjx-math display="true" class=" MJX-TEX"><mjx-mn class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn><mjx-mo space="3" class="mjx-n"><mjx-c c="2212"></mjx-c></mjx-mo><mjx-msup space="3"><mjx-mi class="mjx-i"><mjx-c c="x"></mjx-c></mjx-mi><mjx-script style="vertical-align:0.413em;"><mjx-TeXAtom size="s"><mjx-mo class="mjx-n"><mjx-c c="2212"></mjx-c></mjx-mo><mjx-mn class="mjx-n"><mjx-c c="0"></mjx-c><mjx-c c="."></mjx-c><mjx-c c="1"></mjx-c></mjx-mn></mjx-TeXAtom></mjx-script></mjx-msup><mjx-mo space="4" class="mjx-n"><mjx-c c="2A7D"></mjx-c></mjx-mo><mjx-mi space="4" class="mjx-n"><mjx-c c="3A6"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="("></mjx-c></mjx-mo><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c=")"></mjx-c></mjx-mo><mjx-mo space="4" class="mjx-n"><mjx-c c="2A7D"></mjx-c></mjx-mo><mjx-mn space="4" class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn></mjx-math></mjx-container></p><p></p></div> <h2 id="用法"><a href="#用法" aria-hidden="true" class="header-anchor">#</a> 用法</h2> <h3 id="全局安装"><a href="#全局安装" aria-hidden="true" class="header-anchor">#</a> 全局安装</h3> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">npm</span> <span class="token function">install</span> -g vuepress-plugin-mathjax
<span class="token comment"># 或者</span>
<span class="token function">yarn</span> global <span class="token function">add</span> vuepress-plugin-mathjax
</code></pre></div><h3 id="局部安装"><a href="#局部安装" aria-hidden="true" class="header-anchor">#</a> 局部安装</h3> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">npm</span> <span class="token function">install</span> vuepress-plugin-mathjax
<span class="token comment"># 或者</span>
<span class="token function">yarn</span> <span class="token function">add</span> vuepress-plugin-mathjax
</code></pre></div><h3 id="添加到-config-js"><a href="#添加到-config-js" aria-hidden="true" class="header-anchor">#</a> 添加到 <code>config.js</code></h3> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  plugins<span class="token punctuation">:</span> <span class="token punctuation">[</span>
    <span class="token punctuation">[</span><span class="token string">'mathjax'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
      target<span class="token punctuation">:</span> <span class="token string">'svg'</span><span class="token punctuation">,</span>
      macros<span class="token punctuation">:</span> <span class="token punctuation">{</span>
        <span class="token string">'*'</span><span class="token punctuation">:</span> <span class="token string">'\\times'</span><span class="token punctuation">,</span>
      <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
  <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre></div><p>或者</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  plugins<span class="token punctuation">:</span> <span class="token punctuation">{</span>
    mathjax<span class="token punctuation">:</span> <span class="token punctuation">{</span>
      target<span class="token punctuation">:</span> <span class="token string">'chtml'</span><span class="token punctuation">,</span>
      presets<span class="token punctuation">:</span> <span class="token punctuation">[</span>
        <span class="token string">'\\def\\lr#1#2#3{\\left#1#2\\right#3}'</span><span class="token punctuation">,</span>
      <span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="语法"><a href="#语法" aria-hidden="true" class="header-anchor">#</a> 语法</h2> <h3 id="行内语法"><a href="#行内语法" aria-hidden="true" class="header-anchor">#</a> 行内语法</h3> <p>使用单个 <code>$</code> 围绕一段 TeX 语法进行内联渲染。</p> <p><strong>输入:</strong></p> <pre class="math-block">Euler's identity $e^{i\pi}+1=0$ is a beautiful formula in $\mathbb{R}^2$.
</pre> <p><strong>输出:</strong></p> <div class="math-block"><p>Euler's identity <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-msup><mjx-mi class="mjx-i"><mjx-c c="e"></mjx-c></mjx-mi><mjx-script style="vertical-align:0.363em;"><mjx-TeXAtom size="s"><mjx-mi class="mjx-i"><mjx-c c="i"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c c="3C0"></mjx-c></mjx-mi></mjx-TeXAtom></mjx-script></mjx-msup><mjx-mo space="3" class="mjx-n"><mjx-c c="+"></mjx-c></mjx-mo><mjx-mn space="3" class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn><mjx-mo space="4" class="mjx-n"><mjx-c c="="></mjx-c></mjx-mo><mjx-mn space="4" class="mjx-n"><mjx-c c="0"></mjx-c></mjx-mn></mjx-math></mjx-container> is a beautiful formula in <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-msup><mjx-TeXAtom><mjx-mi class="mjx-ds"><mjx-c c="R"></mjx-c></mjx-mi></mjx-TeXAtom><mjx-script style="vertical-align:0.41em;"><mjx-mn size="s" class="mjx-n"><mjx-c c="2"></mjx-c></mjx-mn></mjx-script></mjx-msup></mjx-math></mjx-container>.</p></div> <h3 id="块语法"><a href="#块语法" aria-hidden="true" class="header-anchor">#</a> 块语法</h3> <p>块语法使用两个符号 <code>$$</code>，它将会带来更大的符号和居中显示。</p> <p><strong>输入:</strong></p> <pre class="math-block">$$\frac {\partial^r} {\partial \omega^r} \left(\frac {y^{\omega}} {\omega}\right) 
= \left(\frac {y^{\omega}} {\omega}\right) \left\{(\log y)^r + \sum_{i=1}^r \frac {(-1)^i r \cdots (r-i+1) (\log y)^{r-i}} {\omega^i} \right\}$$
</pre> <p><strong>输出:</strong></p> <div class="math-block"><p></p><p><mjx-container jax="CHTML" display="true" class="MathJax"><mjx-math display="true" class=" MJX-TEX"><mjx-mfrac><mjx-frac type="d"><mjx-num><mjx-nstrut type="d"></mjx-nstrut><mjx-msup><mjx-mi class="mjx-n"><mjx-c c="2202"></mjx-c></mjx-mi><mjx-script style="vertical-align:0.363em;"><mjx-mi size="s" class="mjx-i"><mjx-c c="r"></mjx-c></mjx-mi></mjx-script></mjx-msup></mjx-num><mjx-dbox><mjx-dtable><mjx-line type="d"></mjx-line><mjx-row><mjx-den><mjx-dstrut type="d"></mjx-dstrut><mjx-mrow><mjx-mi class="mjx-n"><mjx-c c="2202"></mjx-c></mjx-mi><mjx-msup><mjx-mi class="mjx-i"><mjx-c c="3C9"></mjx-c></mjx-mi><mjx-script style="vertical-align:0.363em;"><mjx-mi size="s" class="mjx-i"><mjx-c c="r"></mjx-c></mjx-mi></mjx-script></mjx-msup></mjx-mrow></mjx-den></mjx-row></mjx-dtable></mjx-dbox></mjx-frac></mjx-mfrac><mjx-mrow><mjx-mo class="mjx-s3"><mjx-c c="("></mjx-c></mjx-mo><mjx-mfrac><mjx-frac type="d"><mjx-num><mjx-nstrut type="d"></mjx-nstrut><mjx-msup><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-script style="vertical-align:0.363em;"><mjx-TeXAtom size="s"><mjx-mi class="mjx-i"><mjx-c c="3C9"></mjx-c></mjx-mi></mjx-TeXAtom></mjx-script></mjx-msup></mjx-num><mjx-dbox><mjx-dtable><mjx-line type="d"></mjx-line><mjx-row><mjx-den><mjx-dstrut type="d"></mjx-dstrut><mjx-mi class="mjx-i"><mjx-c c="3C9"></mjx-c></mjx-mi></mjx-den></mjx-row></mjx-dtable></mjx-dbox></mjx-frac></mjx-mfrac><mjx-mo class="mjx-s3"><mjx-c c=")"></mjx-c></mjx-mo></mjx-mrow><mjx-mo space="4" class="mjx-n"><mjx-c c="="></mjx-c></mjx-mo><mjx-mrow space="4"><mjx-mo class="mjx-s3"><mjx-c c="("></mjx-c></mjx-mo><mjx-mfrac><mjx-frac type="d"><mjx-num><mjx-nstrut type="d"></mjx-nstrut><mjx-msup><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-script style="vertical-align:0.363em;"><mjx-TeXAtom size="s"><mjx-mi class="mjx-i"><mjx-c c="3C9"></mjx-c></mjx-mi></mjx-TeXAtom></mjx-script></mjx-msup></mjx-num><mjx-dbox><mjx-dtable><mjx-line type="d"></mjx-line><mjx-row><mjx-den><mjx-dstrut type="d"></mjx-dstrut><mjx-mi class="mjx-i"><mjx-c c="3C9"></mjx-c></mjx-mi></mjx-den></mjx-row></mjx-dtable></mjx-dbox></mjx-frac></mjx-mfrac><mjx-mo class="mjx-s3"><mjx-c c=")"></mjx-c></mjx-mo></mjx-mrow><mjx-mrow><mjx-mo class="mjx-s4"><mjx-c c="{"></mjx-c></mjx-mo><mjx-mo class="mjx-n"><mjx-c c="("></mjx-c></mjx-mo><mjx-mi class="mjx-n"><mjx-c c="l"></mjx-c><mjx-c c="o"></mjx-c><mjx-c c="g"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="2061"></mjx-c></mjx-mo><mjx-mi space="2" class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-msup><mjx-mo class="mjx-n"><mjx-c c=")"></mjx-c></mjx-mo><mjx-script style="vertical-align:0.413em;"><mjx-mi size="s" class="mjx-i"><mjx-c c="r"></mjx-c></mjx-mi></mjx-script></mjx-msup><mjx-mo space="3" class="mjx-n"><mjx-c c="+"></mjx-c></mjx-mo><mjx-munderover space="3"><mjx-over style="padding-bottom:0.192em;padding-left:0.563em;"><mjx-mi size="s" class="mjx-i"><mjx-c c="r"></mjx-c></mjx-mi></mjx-over><mjx-box><mjx-munder><mjx-row><mjx-base><mjx-mo class="mjx-lop"><mjx-c c="2211"></mjx-c></mjx-mo></mjx-base></mjx-row><mjx-row><mjx-under style="padding-top:0.167em;padding-left:0.148em;"><mjx-TeXAtom size="s"><mjx-mi class="mjx-i"><mjx-c c="i"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="="></mjx-c></mjx-mo><mjx-mn class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn></mjx-TeXAtom></mjx-under></mjx-row></mjx-munder></mjx-box></mjx-munderover><mjx-mfrac space="2"><mjx-frac type="d"><mjx-num><mjx-nstrut type="d"></mjx-nstrut><mjx-mrow><mjx-mo class="mjx-n"><mjx-c c="("></mjx-c></mjx-mo><mjx-mo class="mjx-n"><mjx-c c="2212"></mjx-c></mjx-mo><mjx-mn class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn><mjx-msup><mjx-mo class="mjx-n"><mjx-c c=")"></mjx-c></mjx-mo><mjx-script style="vertical-align:0.363em;"><mjx-mi size="s" class="mjx-i"><mjx-c c="i"></mjx-c></mjx-mi></mjx-script></mjx-msup><mjx-mi class="mjx-i"><mjx-c c="r"></mjx-c></mjx-mi><mjx-mo space="2" class="mjx-n"><mjx-c c="22EF"></mjx-c></mjx-mo><mjx-mo space="2" class="mjx-n"><mjx-c c="("></mjx-c></mjx-mo><mjx-mi class="mjx-i"><mjx-c c="r"></mjx-c></mjx-mi><mjx-mo space="3" class="mjx-n"><mjx-c c="2212"></mjx-c></mjx-mo><mjx-mi space="3" class="mjx-i"><mjx-c c="i"></mjx-c></mjx-mi><mjx-mo space="3" class="mjx-n"><mjx-c c="+"></mjx-c></mjx-mo><mjx-mn space="3" class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn><mjx-mo class="mjx-n"><mjx-c c=")"></mjx-c></mjx-mo><mjx-mo class="mjx-n"><mjx-c c="("></mjx-c></mjx-mo><mjx-mi class="mjx-n"><mjx-c c="l"></mjx-c><mjx-c c="o"></mjx-c><mjx-c c="g"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="2061"></mjx-c></mjx-mo><mjx-mi space="2" class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-msup><mjx-mo class="mjx-n"><mjx-c c=")"></mjx-c></mjx-mo><mjx-script style="vertical-align:0.363em;"><mjx-TeXAtom size="s"><mjx-mi class="mjx-i"><mjx-c c="r"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c="2212"></mjx-c></mjx-mo><mjx-mi class="mjx-i"><mjx-c c="i"></mjx-c></mjx-mi></mjx-TeXAtom></mjx-script></mjx-msup></mjx-mrow></mjx-num><mjx-dbox><mjx-dtable><mjx-line type="d"></mjx-line><mjx-row><mjx-den><mjx-dstrut type="d"></mjx-dstrut><mjx-msup><mjx-mi class="mjx-i"><mjx-c c="3C9"></mjx-c></mjx-mi><mjx-script style="vertical-align:0.363em;"><mjx-mi size="s" class="mjx-i"><mjx-c c="i"></mjx-c></mjx-mi></mjx-script></mjx-msup></mjx-den></mjx-row></mjx-dtable></mjx-dbox></mjx-frac></mjx-mfrac><mjx-mo class="mjx-s4"><mjx-c c="}"></mjx-c></mjx-mo></mjx-mrow></mjx-math></mjx-container></p><p></p></div> <h3 id="一些约定"><a href="#一些约定" aria-hidden="true" class="header-anchor">#</a> 一些约定</h3> <p>markdown 文件中的 TeX 语法将遵循 <a href="http://pandoc.org/MANUAL.html#math" target="_blank" rel="noopener noreferrer">pandoc<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 制定的准则：</p> <blockquote><p>两个 $ 之间的任何内容都将被视为 TeX 语法。开头的 $ 必须在其右边有一个非空格字符，而结尾的 $ 必须在其左边有一个非空格字符，并且不能立即跟随一个数字。因此 $20,000 和 $30,000 将不会解析为 TeX。如果由于某种原因你需要将文本置于 $ 字符中，则使用反斜杠转义它们即可。</p></blockquote> <h2 id="特性"><a href="#特性" aria-hidden="true" class="header-anchor">#</a> 特性</h2> <h3 id="使用宏"><a href="#使用宏" aria-hidden="true" class="header-anchor">#</a> 使用宏</h3> <p>这是这个项目的 <code>config.js</code> 中的插件部分：</p> <div class="language-js extra-class"><pre class="language-js"><code>module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token punctuation">{</span>
  plugins<span class="token punctuation">:</span> <span class="token punctuation">{</span>
    mathjax<span class="token punctuation">:</span> <span class="token punctuation">{</span>
      macros<span class="token punctuation">:</span> <span class="token punctuation">{</span>
        <span class="token string">'\\Z'</span><span class="token punctuation">:</span> <span class="token string">'\\mathbb{Z}'</span>
      <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><p><strong>输入:</strong></p> <pre class="math-block">若 $a, n\in\Z$，则 $a&gt;n &lt;=&gt; a&gt;=n+1$。
</pre> <p><strong>输出:</strong></p> <div class="math-block"><p>若 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mi class="mjx-i"><mjx-c c="a"></mjx-c></mjx-mi><mjx-mo class="mjx-n"><mjx-c c=","></mjx-c></mjx-mo><mjx-mi space="2" class="mjx-i"><mjx-c c="n"></mjx-c></mjx-mi><mjx-mo space="4" class="mjx-n"><mjx-c c="2208"></mjx-c></mjx-mo><mjx-TeXAtom space="4"><mjx-mi class="mjx-ds"><mjx-c c="Z"></mjx-c></mjx-mi></mjx-TeXAtom></mjx-math></mjx-container>，则 <mjx-container jax="CHTML" class="MathJax"><mjx-math class=" MJX-TEX"><mjx-mi class="mjx-i"><mjx-c c="a"></mjx-c></mjx-mi><mjx-mo space="4" class="mjx-n"><mjx-c c="&gt;"></mjx-c></mjx-mo><mjx-mi space="4" class="mjx-i"><mjx-c c="n"></mjx-c></mjx-mi><mjx-mo space="4" class="mjx-n"><mjx-c c="21D4"></mjx-c></mjx-mo><mjx-mi space="4" class="mjx-i"><mjx-c c="a"></mjx-c></mjx-mi><mjx-mo space="4" class="mjx-n"><mjx-c c="2A7E"></mjx-c></mjx-mo><mjx-mi space="4" class="mjx-i"><mjx-c c="n"></mjx-c></mjx-mi><mjx-mo space="3" class="mjx-n"><mjx-c c="+"></mjx-c></mjx-mo><mjx-mn space="3" class="mjx-n"><mjx-c c="1"></mjx-c></mjx-mn></mjx-math></mjx-container>。</p></div> <h3 id="使用预设"><a href="#使用预设" aria-hidden="true" class="header-anchor">#</a> 使用预设 <span class="badge tip" style="vertical-align:top;" data-v-c13ee5b0>vuepress 1.0.0-alpha.39+</span></h3> <p>这是这个页面的 frontmatter:</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">sidebarDepth</span><span class="token punctuation">:</span> <span class="token number">3</span>
<span class="token key atrule">mathjax</span><span class="token punctuation">:</span>
  <span class="token key atrule">presets</span><span class="token punctuation">:</span> <span class="token string">'\def\lr#1#2#3{\left#1#2\right#3}'</span>
<span class="token punctuation">---</span>
</code></pre></div><p><strong>输入:</strong></p> <pre class="math-block">$$\frac\partial{\partial t} \lr({\frac{y^t}t})$$
</pre> <p><strong>输出:</strong></p> <div class="math-block"><p></p><p><mjx-container jax="CHTML" display="true" class="MathJax"><mjx-math display="true" class=" MJX-TEX"><mjx-mfrac><mjx-frac type="d"><mjx-num><mjx-nstrut type="d"></mjx-nstrut><mjx-mi class="mjx-n"><mjx-c c="2202"></mjx-c></mjx-mi></mjx-num><mjx-dbox><mjx-dtable><mjx-line type="d"></mjx-line><mjx-row><mjx-den><mjx-dstrut type="d"></mjx-dstrut><mjx-mrow><mjx-mi class="mjx-n"><mjx-c c="2202"></mjx-c></mjx-mi><mjx-mi class="mjx-i"><mjx-c c="t"></mjx-c></mjx-mi></mjx-mrow></mjx-den></mjx-row></mjx-dtable></mjx-dbox></mjx-frac></mjx-mfrac><mjx-mrow><mjx-mo class="mjx-s3"><mjx-c c="("></mjx-c></mjx-mo><mjx-mfrac><mjx-frac type="d"><mjx-num><mjx-nstrut type="d"></mjx-nstrut><mjx-msup><mjx-mi class="mjx-i"><mjx-c c="y"></mjx-c></mjx-mi><mjx-script style="vertical-align:0.363em;"><mjx-mi size="s" class="mjx-i"><mjx-c c="t"></mjx-c></mjx-mi></mjx-script></mjx-msup></mjx-num><mjx-dbox><mjx-dtable><mjx-line type="d"></mjx-line><mjx-row><mjx-den><mjx-dstrut type="d"></mjx-dstrut><mjx-mi class="mjx-i"><mjx-c c="t"></mjx-c></mjx-mi></mjx-den></mjx-row></mjx-dtable></mjx-dbox></mjx-frac></mjx-mfrac><mjx-mo class="mjx-s3"><mjx-c c=")"></mjx-c></mjx-mo></mjx-mrow></mjx-math></mjx-container></p><p></p></div> <h2 id="配置"><a href="#配置" aria-hidden="true" class="header-anchor">#</a> 配置</h2> <p>标有 <span class="badge tip" style="vertical-align:;" data-v-c13ee5b0>frontmatter</span>记号的配置在 VuePress 1.0.0-alpha.39 以上的版本中将允许写在页面的 frontmatter 的 <code>mathjax</code> 选项中。例如：</p> <div class="language-yaml extra-class"><pre class="language-yaml"><code><span class="token punctuation">---</span>
<span class="token key atrule">mathjax</span><span class="token punctuation">:</span>
  <span class="token key atrule">presets</span><span class="token punctuation">:</span> <span class="token string">'\def\lr#1#2#3{\left#1#2\right#3}'</span>
<span class="token punctuation">---</span>
</code></pre></div><h3 id="target"><a href="#target" aria-hidden="true" class="header-anchor">#</a> target</h3> <ul><li><strong>类型</strong>: <code>'svg' | 'chtml'</code></li> <li><strong>默认值</strong>: <code>'chtml'</code></li></ul> <p>MathJax 的输出格式。</p> <h3 id="packages"><a href="#packages" aria-hidden="true" class="header-anchor">#</a> packages</h3> <ul><li><strong>类型</strong>: <code>string | string[]</code></li> <li><strong>默认值</strong>: 所有可以加载的 MathJax 包</li></ul> <p>设置使用的 MathJax 包。</p> <h3 id="macros"><a href="#macros" aria-hidden="true" class="header-anchor">#</a> macros</h3> <ul><li><strong>类型</strong>: <code>{ [key: string]: string | null }</code></li> <li><strong>默认值</strong>: <code>{}</code></li></ul> <p>输入的宏将与内置的宏进行混合。如果要取消一个内置的宏替换，可以将对应的值设为 <code>null</code>。下面是一张内置宏的列表：</p> <div class="language- extra-class"><pre class="language-text"><code>Not found: /home/travis/build/vuepress/vuepress.github.io/src/defaultMacros.js</code></pre></div><h3 id="presets"><a href="#presets" aria-hidden="true" class="header-anchor">#</a> presets <span class="badge tip" style="vertical-align:top;" data-v-c13ee5b0>frontmatter</span></h3> <ul><li><strong>类型</strong>: <code>string | string[]</code></li> <li><strong>默认值</strong>: <code>[]</code></li></ul> <p>要添加的预设内容。预设内容会自动插入到要编译的 TeX 代码前。</p> <h3 id="showerror"><a href="#showerror" aria-hidden="true" class="header-anchor">#</a> showError <span class="badge tip" style="vertical-align:top;" data-v-c13ee5b0>vuepress 1.0.0-alpha.40+</span></h3> <ul><li><strong>类型</strong>: <code>boolean</code></li> <li><strong>默认值</strong>: <code>process.env.NODE_ENV === 'development'</code></li></ul> <p>当遇到编译错误时，是否要在控制台输出错误信息。</p> <h3 id="cache"><a href="#cache" aria-hidden="true" class="header-anchor">#</a> cache</h3> <ul><li><strong>type</strong>: <code>false | object</code></li> <li><strong>default</strong>: <code>{}</code></li></ul> <p><a href="https://github.com/isaacs/node-lru-cache" target="_blank" rel="noopener noreferrer">LRU Cache<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> 选项。如果设为 <code>false</code>，将不会使用缓存。</p> <h2 id="其他"><a href="#其他" aria-hidden="true" class="header-anchor">#</a> 其他</h2> <h3 id="依赖"><a href="#依赖" aria-hidden="true" class="header-anchor">#</a> 依赖</h3> <p>这个插件目前使用 <a href="https://github.com/mathjax/mathjax-v3" target="_blank" rel="noopener noreferrer">mathjax-v3<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>（早期测试版），因此可能不适合生产环境。</p> <h3 id="相关工具"><a href="#相关工具" aria-hidden="true" class="header-anchor">#</a> 相关工具</h3> <p>这个插件的部分灵感来自其他一些库，谢谢你们！</p> <ul><li><a href="https://github.com/zlliang/vuepress-plugin-latex" target="_blank" rel="noopener noreferrer">vuepress-plugin-latex<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><a href="https://github.com/waylonflinn/markdown-it-katex" target="_blank" rel="noopener noreferrer">markdown-it-katex<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><a href="https://github.com/goessner/markdown-it-texmath" target="_blank" rel="noopener noreferrer">markdown-it-texmath<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><a href="https://github.com/classeur/markdown-it-mathjax" target="_blank" rel="noopener noreferrer">markdown-it-mathjax<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li> <li><a href="https://github.com/yamavol/markdown-it-mathjax-chtml" target="_blank" rel="noopener noreferrer">markdown-it-mathjax-chtml<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/vuepress/vuepress.github.io/edit/master/docs/zh/plugins/mathjax.md" target="_blank" rel="noopener noreferrer">在 GitHub 上编辑此页</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <div class="last-updated"><span class="prefix">上次更新: </span> <span class="time">7/2/2019, 5:55:59 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/zh/plugins/git-log/" class="prev">
          vuepress-plugin-git-log
        </a></span> <span class="next"><a href="/zh/plugins/medium-zoom/">
          vuepress-plugin-medium-zoom
        </a>
        →
      </span></p></div> </main></div><div class="global-ui"><!----></div></div>
    <script src="/assets/js/app.83cb924b.js" defer></script><script src="/assets/js/2.96e68d5e.js" defer></script><script src="/assets/js/28.68a7bdf2.js" defer></script><script src="/assets/js/6.b1866fbb.js" defer></script><script src="/assets/js/5.1cd3ace7.js" defer></script>
  </body>
</html>
